package cn.wolfcode.crm.qo;

import cn.wolfcode.crm.util.StringUtil;
import lombok.Getter;
import lombok.Setter;
import org.springframework.stereotype.Component;

@Getter
@Setter
@Component
public class QueryObject {
    private Long customerId;
    private String keyword;
    private Integer currentPage = 1;
    private Integer pageSize = 5;
    private Long sellerEId;

    public int getStart() {
        return (currentPage - 1) * pageSize;
    }

    public String getKeyword() {
        return StringUtil.hasLength(this.keyword) ? this.keyword.replaceAll(" ", "") : null;
    }
}
